#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
	pid_t pidid;
	printf("[%d]:begin\n",getpid());
	fflush(NULL);
	pidid=fork();
	if(pidid<0)
	{
		perror("error");
		return -1;
	}
	else if(pidid>0)
	{
		printf("[%d,%d]parent is working \n",getpid(),pidid);
	}
	else
		printf("[%d,%d]child is working \n",getpid(),pidid);

	printf("[%d]end\n",getpid());

	return 0;
}
